#ifndef GAMEPADTHREAD_H
#define GAMEPADTHREAD_H

#include <QThread>
#include <QTimer>
#include "SDL_gamecontroller.h"
#include "SDL_joystick.h"
#include "gamepadstate.h"
#include <QDebug>




class GamepadThread : public QThread
{
    Q_OBJECT
public:
    GamepadThread();
    ~GamepadThread();

private:
    GamepadState_t gamepadState;
    SDL_Joystick *joystick = NULL;

public slots:
    void run();
    int setRumble(uint16_t left, uint16_t right, uint32_t duration);
    void checkForGamepad();
};

extern GamepadState_t GamepadState;
extern GamepadThread *UsergamepadThread;


#endif // GAMEPADTHREAD_H
